<template>
	<view>
		<view class="loan_box">
			<view class="loan_title_box">
			</view>
			<view class="loan_list">
				<view class="list_item" v-for="(item,index) in productList" :key="index">
					<view class="item_head" @click="xiagnqing(item)">
						<view>
							<image class="pic" src="../../../static/OIP-C.jpg" mode=""></image>
						</view>
						<view class="bottom_item">
							<view>
								<text class="c1">{{item.theTheme}}</text>
							</view>
							<view>
								<text class="c1">{{item.theAuthor}} {{item.createTime}}</text>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				productList: [],
			}
		},
		onLoad() {
			// 查看所有公告
			this.see()
		},
		methods: {
			//查看所有社区活动
			see() {
				this.$axios({
					url: '/systemuser/announcement/getAnnouncement',
					data: {
						id: 1,
					},
					method: 'GET',
					success: (res) => {
						console.log(res)
						if (res.data.success == true) {
							this.productList = res.data.data.list
						}
					}
				})
			},
			//查看活动详情
			xiagnqing(item){
				uni.navigateTo({
					url: `./activitiesxiangqing?item=${encodeURIComponent(JSON.stringify(item))}`,
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.loan_list {
		margin-top: 30rpx;

		.list_item {
			padding: 0 10rpx;
			border-bottom: 1px solid #e9e9e9;
			margin-top: 20rpx;

			.item_head {
				display: flex;
				align-items: center;

				.pic {
					height: 150rpx;
					width: 150rpx;
				}

				.loan_info {
					margin-left: 20rpx;

					.name {
						color: #797979;
						font-weight: 600;
					}

					.date {
						color: #797979;
						margin-top: 6rpx;
					}
				}

				.join_btn {
					background-color: #2979ff;
					color: #fff;
					margin-left: auto;
					margin-right: 20rpx;
					padding: 6rpx 30rpx;
					border-radius: 30rpx;
					font-size: 28rpx;
				}
			}

			.item_bottom {
				display: flex;
				margin-top: 20rpx;
				padding-bottom: 14rpx;
				width: 100%;

				.bottom_item {
					margin-left: 100rpx;
					flex: 1;
					display: flex;
					flex-direction: column;
					align-items: flex-start;
					justify-content: center;
					font-size: 26rpx;
					text-align: right;
					padding-left: 300rpx;

					.names {
						color: #797979;
					}

					.amount {
						color: #ff0548;
						margin-top: 6rpx;
						font-weight: 600;
					}
				}
			}
		}
	}

	.c1 {
		margin-left: 20rpx;
	}

	.loan_list {
		margin-top: 30rpx;

		.list_item {
			padding: 0 10rpx;
			border-bottom: 1px solid #e9e9e9;
			margin-top: 20rpx;

			.item_head {
				display: flex;
				align-items: center;

				.pic {
					height: 150rpx;
					width: 150rpx;
				}

				.loan_info {
					margin-left: 20rpx;

					.name {
						color: #797979;
						font-weight: 600;
					}

					.date {
						color: #797979;
						margin-top: 6rpx;
					}
				}

				.join_btn {
					background-color: #2979ff;
					color: #fff;
					margin-left: auto;
					margin-right: 20rpx;
					padding: 6rpx 30rpx;
					border-radius: 30rpx;
					font-size: 28rpx;
				}
			}

			.item_bottom {
				display: flex;
				margin-top: 20rpx;
				padding-bottom: 14rpx;
				width: 100%;

				.bottom_item {
					margin-left: 100rpx;
					flex: 1;
					display: flex;
					flex-direction: column;
					align-items: flex-start;
					justify-content: center;
					font-size: 26rpx;
					text-align: right;
					padding-left: 300rpx;

					.names {
						color: #797979;
					}

					.amount {
						color: #ff0548;
						margin-top: 6rpx;
						font-weight: 600;
					}
				}
			}
		}
	}

	.loan_box {
		background-color: #fff;
		width: 90%;
		margin: 20rpx auto;
		border-radius: 10rpx;
		box-shadow: 5px 5px 10px 5px #c5c5c5;
		padding: 10rpx 20rpx;
		padding-bottom: 20rpx;
		box-sizing: border-box;

		.loan_title_box {
			display: flex;
			align-items: center;
			padding-top: 6rpx;

			.title {
				font-size: 30rpx;
			}

			.link {
				margin-left: auto;
				color: #797979;
				font-size: 20rpx;
			}
		}

		.loan_list {
			margin-top: 30rpx;

			.list_item {
				padding: 0 10rpx;
				border-bottom: 1px solid #e9e9e9;
				margin-top: 20rpx;

				.item_head {
					display: flex;
					align-items: center;

					.pic {
						height: 150rpx;
						width: 150rpx;
					}

					.loan_info {
						margin-left: 20rpx;

						.name {
							color: #797979;
							font-weight: 600;
						}

						.date {
							color: #797979;
							margin-top: 6rpx;
						}
					}

					.join_btn {
						background-color: #2979ff;
						color: #fff;
						margin-left: auto;
						margin-right: 20rpx;
						padding: 6rpx 30rpx;
						border-radius: 30rpx;
						font-size: 28rpx;
					}
				}

				.item_bottom {
					display: flex;
					margin-top: 20rpx;
					padding-bottom: 14rpx;
					width: 100%;

					.bottom_item {
						margin-left: 100rpx;
						flex: 1;
						display: flex;
						flex-direction: column;
						align-items: flex-start;
						justify-content: center;
						font-size: 26rpx;
						text-align: right;
						padding-left: 300rpx;

						.names {
							color: #797979;
						}

						.amount {
							color: #ff0548;
							margin-top: 6rpx;
							font-weight: 600;
						}
					}
				}
			}
		}
	}
</style>
